package com.cloudcc.mobile.view.main.fragment;

import com.cloudcc.mobile.AppConfig;
import com.cloudcc.mobile.view.base.BaseFragment;

public abstract class BaseListFragment extends BaseFragment {

	protected int currentPage = AppConfig.DEFAULTPAGE;

	public void onRefreshData() {
		currentPage = AppConfig.DEFAULTPAGE;
		requestData();
	}

	public void onLoadMoreData() {
		currentPage++;
		requestData();
	}

	/**
	 * 是不是 刷新加载的 或者第一次初始化加载
	 * 
	 * @return true 来自刷新的加载
	 */
	protected boolean isFromRefresh() {
		return currentPage <= AppConfig.DEFAULTPAGE;
	}

	/**
	 * 网络或者缓存请求数据
	 */
	public abstract void requestData();

}
